home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr18 / ter99.zip / PASCAL._XE / XLATE.PAS < prev   
Pascal/Delphi Source File  |  1993-05-03  |  1KB  |  48 lines

  1.  
  2. { Small sample program to show how the translation files are build or if }
  3. { you want to make a converter from other programs                       }
  4.  
  5. Type
  6.  
  7.   TranslationType = Record
  8.                       TableNote : String[54];
  9.                       InTable,
  10.                       OutTable   : Array[0..255] of Char;
  11.                       Filler     : Array[1..33] of Char;
  12.                     End;
  13.  
  14.  
  15. Var
  16.   T : TranslationType;
  17.   F : File of TranslationType;
  18.  
  19.   X : Byte;
  20.  
  21. Begin
  22.   WriteLn('Terminate translation viewer, by Bo Bendtsen 1993');
  23.   If Paramcount<>1 Then WriteLn('Syntax: XLATE filename.xlt')
  24.   Else Begin
  25.     Assign(F,ParamStr(1));
  26.     {$I-} Reset(F); {$I+}
  27.     If IOResult=0 Then
  28.     Begin
  29.       Read(F,T);
  30.       Close(F);
  31.       WriteLn;
  32.       WriteLn('Incoming translation:');
  33.       For X:=0 to 255 Do 
  34.         If x<>Ord(T.InTable[x]) Then 
  35.           WriteLn(x,' ',Ord(T.InTable[x]),' ('+T.InTable[x]+')');
  36.       WriteLn; 
  37.       WriteLn('Outgoing translation:');
  38.       For X:=0 to 255 Do 
  39.         If x<>Ord(T.OutTable[x]) Then 
  40.           WriteLn(x,' ',Ord(T.OutTable[x]),' ('+T.OutTable[x]+')');
  41.       WriteLn(#10'Table: '+T.TableNote);
  42.     End
  43.     Else 
  44.       WriteLn('Could not open file');
  45.   End
  46. End.
  47.  
  48.